﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace BGSpaceShooterServer
{
    public class StarFighterComponent
    {
        public BoundingSphere BoundingSphere { get; set; }
        public bool HPChanged { get; set; }
        /// <summary>
        /// Używane w cliencie // split?
        /// </summary>
        public DateTime LastHPUpdate { get; set; }
        private int hp;
        public virtual int HP
        {
            get
            {
                return hp;
            }
            set
            {
                HPChanged = true;
                hp = value;
            }
        }
        public int MaxHP { get; set; }
        public string MeshName { get; set; }
        public int ID { get; set; }

        public float HealthPercent
        {
            get
            {
                if (HP < 0)
                {
                    return 0;
                }
                return (float)HP / (float)MaxHP;
            }
        }

        public StarFighterComponent()
        {
            LastHPUpdate = DateTime.Now;
        }


    }
}
